Skip to content
This repository has been archived by the owner on Jul 31, 2018. It is now read-only.

Add webpack modulesDirectories option and replace ES7 autobinding with ES7 property declaration #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dbertella
Copy link

I think the modulesDirectories option in webpack is a realy handy way to handle modules, and I'm not sure about autobinding, but I don't think it's the best way to use methods since it will bind a new function in every render cycle. I may be wrong, feel free to deny it if I am

@eddyystop
Copy link

eddyystop commented May 5, 2016

Webpack's moduleDirectories is a very nice way to walk directories a la node_modules. I used it for shared folders.

However you will have to create a Webpack bundle before running tests on Node, and that slows the tests down.

Babel has a module resolver feature and with babel-plugin-resolver you obtain the same features that NODE_PATH provides Node.

I've switched to babel-plugin-resolver because I can run tests using babel-register alone which is faster than creating a Webpack bundle. It also doesn't tie me into Webpack for a build system..

You of course will still have to create a bundle if you require Webpack loaders e.g. import style from './style.css'.

@dbertella
Copy link
Author

Sure, you are right about it I'll have to use karma to run test actually, I
will look into it than. Can be useful.

2016-05-05 12:41 GMT+02:00 Eddyystop [email protected]:

Webpack's moduleDirectories is a very nice way to walk directories a la
node_modules. I used it for shared folders.

However you will have to create a Webpack bundle before running tests on
Node, and that slows the tests down.

Babel has a module resolver feature and with babel-plugin-resolver you
obtain the same features that NODE_PATH provides Node.

I've switched to babel-plugin-resolver because I can run tests using
babel-register which is faster than creating a Webpack bundle.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#76 (comment)

Daniele Bertella
*Front end developer *

+39.340.490.57.80
LinkedIn: danielebertella http://it.linkedin.com/in/danielebertella/
Twitter: _denb https://twitter.com/_denb
www.danielebertella.com

@tracker1
Copy link

tracker1 commented May 7, 2016

I've been preferring to set aliases, so that I can set an alias to "lib", "shared", etc... and just require('lib/...') It's a bit of a break from the "node way" but, it's worked for me...

A somewhat convoluted webpack config

@tj
Copy link
Owner

tj commented May 7, 2016

I've been using browserify instead now, not sure when I'll have time to update this though

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants